home *** CD-ROM | disk | FTP | other *** search
/ PC for Alla 2005 May / PC för Alla 0505.iso / fullversioner / realsoft3d / data1.cab / Scripting / scripts / js / oops / r3task.js < prev    next >
Encoding:
JavaScript  |  2005-04-04  |  4.9 KB  |  188 lines

  1.  
  2. // JavaScript wrapper for r3task.h
  3. // Auto generated file, do not modify by hand
  4. // Copyrights 2002, Realsoft Graphics Oy
  5.  
  6. var R3_TASK_H = 1;
  7. include("oops/r3root.js")
  8.  
  9.  
  10. var R3CLID_TASK = 1;
  11.  
  12.  
  13.  
  14.  
  15. // Description: Wait one or more signal objects.
  16. //      Note, the task must own the signals to be waited.
  17. // p3: R3TAG *, one or more R3TA_Signal tags with signals to be waited 
  18.  
  19. R3TM_WAIT = 1000;
  20.  
  21. function mR3TM_WAIT(p3) {
  22.   R3Do(this.r3obj, R3TM_WAIT, p3);
  23. }
  24.  
  25. // Description: A class message. Finds a task object with given name 
  26. // Returns: Object, address of the task or NULL if task was not found
  27. // p3: String(0), name of the task to be found 
  28.  
  29. R3TCM_FIND_TASK = 1001;
  30.  
  31. function mR3TCM_FIND_TASK(p3) {
  32.   return   R3DoA(this.r3obj, R3TCM_FIND_TASK, p3);
  33. }
  34.  
  35. // Description: Allocates signal from the tasks signal pool.
  36. // Returns: Integer, If succeeded, non-negative value indentifying the allocated signal.
  37. //      If failed, negative value is returned. NOTE: you don't need this
  38. //      method unless you are going to implement new signal objects.
  39.  
  40. R3TM_ALLOCSIG = 1002;
  41.  
  42. function mR3TM_ALLOCSIG() {
  43.   return   R3DoA(this.r3obj, R3TM_ALLOCSIG, 0);
  44. }
  45.  
  46. // Description: Free signal. NOTE: you don't need this method unless you are
  47. //      going to implement new signal objects.
  48. // p3: Integer, signal identifier. 
  49.  
  50. R3TM_FREESIG = 1003;
  51.  
  52. function mR3TM_FREESIG(p3) {
  53.   R3DoA(this.r3obj, R3TM_FREESIG, p3);
  54. }
  55.  
  56. // Description: Return the last interrupt handled. (interrupt here == Unix signal)
  57.  
  58. R3TM_LASTINTERRUPT = 1004;
  59.  
  60. function mR3TM_LASTINTERRUPT() {
  61.   R3DoA(this.r3obj, R3TM_LASTINTERRUPT, 0);
  62. }
  63.  
  64.  
  65.  
  66.  
  67. // R3TA_Stack: Integer, size of the stack in bytes 
  68. R3TA_Stack = 1500;
  69. function SetR3TA_Stack(value) {
  70.   R3Set(this.r3obj, R3TA_Stack, value); 
  71. }
  72.  
  73. function GetR3TA_Stack() {
  74.   return R3Get(this.r3obj, R3TA_Stack, R3TID_INTEGER, TRUE); // R3INT
  75. }
  76.  
  77. // R3TA_Code: address of the function to be called by the task object to be created 
  78. R3TA_Code = 1501;
  79. function SetR3TA_Code(value) {
  80.   R3Set(this.r3obj, R3TA_Code, value); 
  81. }
  82.  
  83. function GetR3TA_Code() {
  84.   return R3Get(this.r3obj, R3TA_Code, R3TID_INTEGER, TRUE); // void(*)(...)
  85. }
  86.  
  87. // R3TA_Data: Object, User specific data for the thread, this will automatically be freed when the task is terminated 
  88. R3TA_Data = 1502;
  89. function SetR3TA_Data(value) {
  90.   R3Set(this.r3obj, R3TA_Data, value); 
  91. }
  92.  
  93. function GetR3TA_Data() {
  94.   return R3Get(this.r3obj, R3TA_Data, R3TID_INTEGER, TRUE); // void*
  95. }
  96.  
  97. // R3TA_DataSize: Integer, size of the user specific data 
  98. R3TA_DataSize = 1503;
  99. function SetR3TA_DataSize(value) {
  100.   R3Set(this.r3obj, R3TA_DataSize, value); 
  101. }
  102.  
  103. function GetR3TA_DataSize() {
  104.   return R3Get(this.r3obj, R3TA_DataSize, R3TID_INTEGER, TRUE); // R3INT
  105. }
  106.  
  107. // R3TA_Param: Integer, one or more parameters for the function to be executed 
  108. R3TA_Param = 1504;
  109. function SetR3TA_Param(value) {
  110.   R3Set(this.r3obj, R3TA_Param, value); 
  111. }
  112.  
  113. function GetR3TA_Param() {
  114.   return R3Get(this.r3obj, R3TA_Param, R3TID_INTEGER, TRUE); // R3INT
  115. }
  116.  
  117. // R3TA_Priority: Integer, see priority codes below 
  118. R3TA_Priority = 1505;
  119. function SetR3TA_Priority(value) {
  120.   R3Set(this.r3obj, R3TA_Priority, value); 
  121. }
  122.  
  123. function GetR3TA_Priority() {
  124.   return R3Get(this.r3obj, R3TA_Priority, R3TID_INTEGER, TRUE); // R3INT
  125. }
  126.  
  127. // R3TA_Signal: Object, tag for the R3TM_WAIT method 
  128. R3TA_Signal = 1506;
  129. function SetR3TA_Signal(value) {
  130.   R3Set(this.r3obj, R3TA_Signal, value); 
  131. }
  132.  
  133. function GetR3TA_Signal() {
  134.   return R3Get(this.r3obj, R3TA_Signal, R3TID_INTEGER, TRUE); // R3OBJ*
  135. }
  136.  
  137. // R3TA_ThreadId: Integer, task identifier 
  138. R3TA_ThreadId = 1507;
  139. function SetR3TA_ThreadId(value) {
  140.   R3Set(this.r3obj, R3TA_ThreadId, value); 
  141. }
  142.  
  143. function GetR3TA_ThreadId() {
  144.   return R3Get(this.r3obj, R3TA_ThreadId, R3TID_INTEGER, TRUE); // R3INT
  145. }
  146.  
  147. var R3TPRI_IDLE = 0;
  148. var R3TPRI_LOWEST = 1;
  149. var R3TPRI_BELOWNORMAL = 2;
  150. var R3TPRI_NORMAL = 3;
  151. var R3TPRI_ABOVENORMAL = 4;
  152. var R3TPRI_HIGHEST = 5;
  153. var R3TASK_MAXSIGNALS = 15;
  154.  
  155.  
  156. function r3Task () { 
  157.    this.base = r3God;
  158.    if(arguments.length) {
  159.       this.base(R3CLID_TASK, arguments);
  160.    }
  161.    // Methods
  162.    this.WAIT=mR3TM_WAIT;
  163.    this.FIND_TASK=mR3TCM_FIND_TASK;
  164.    this.ALLOCSIG=mR3TM_ALLOCSIG;
  165.    this.FREESIG=mR3TM_FREESIG;
  166.    this.LASTINTERRUPT=mR3TM_LASTINTERRUPT;
  167.  
  168.    // Attributes
  169.    this.GetStack=GetR3TA_Stack;
  170.    this.SetStack=SetR3TA_Stack;
  171.    this.GetCode=GetR3TA_Code;
  172.    this.SetCode=SetR3TA_Code;
  173.    this.GetData=GetR3TA_Data;
  174.    this.SetData=SetR3TA_Data;
  175.    this.GetDataSize=GetR3TA_DataSize;
  176.    this.SetDataSize=SetR3TA_DataSize;
  177.    this.GetParam=GetR3TA_Param;
  178.    this.SetParam=SetR3TA_Param;
  179.    this.GetPriority=GetR3TA_Priority;
  180.    this.SetPriority=SetR3TA_Priority;
  181.    this.GetSignal=GetR3TA_Signal;
  182.    this.SetSignal=SetR3TA_Signal;
  183.    this.GetThreadId=GetR3TA_ThreadId;
  184.    this.SetThreadId=SetR3TA_ThreadId;
  185. }
  186.  
  187. r3Task.prototype=new r3Root;
  188. // r3task.h_H